var baseUrl = 'http://172.16.22.205:8091' //基础链接
var isDebug = false //是否开启打印模式
var Api = {
  point: 'point', //接口的参数
  myPost: function (api, data, success) {
    console.log('jinlailema')
    var url = baseUrl + api
    if (isDebug) {
      console.log('[URL]' + url)
      console.log('[PARM]' + JSON.stringify(data))
    }
    $.post(
      url,
      data,
      function (obj) {
        if (isDebug) console.log('[Res]' + JSON.stringify(obj))
        success(obj)
      },
      'json'
    )
  },

  myGet: function (api, data, success, error) {
    var url = baseUrl + api + data
    if (isDebug) {
      console.log('[URL]' + url)
      console.log('[PARM]' + JSON.stringify(data))
    }
    $.get(url, function (obj) {
      obj = JSON.parse(obj)
      if (isDebug) console.log('[Res]' + JSON.stringify(obj))
      success(obj)
    })
  },
}
